<%=content_for :head do%> <title>home index</title>
<%end%>
<%= render "shared/logon"%>
<%= render "shared/footer"%>
<h1>Listing giohang</h1>

<table>
  <tr>
    <th>username</th>
    <th>product title</th>
    <th></th>
  </tr>
<%@giohangs.each do |giohang|%>
<%@user = User.find(giohang.userid)%>
<%@product = Product.find(giohang.productid)%>
<tr>
    <td><%= @user.username %></td>
    <td><%= @product.title %></td>
    <td><%= link_to "bán", banhang_path ,:params=>{:giohangid =>giohang.id}%></td>
  </tr>
<%end%>
